package com.zhijiang.hospital.entity.Permission;

import lombok.Data;

import java.util.List;

/**
 * @author 75936
 * @version 1.0
 * @project zhijiang_hospital_datas
 * @description
 * @date 2023-03-21 11:51:02
 */
@Data
public class Role {
    private String emplName;           // 角色名称
    private List<Integer> permissions; // 角色拥有的权限列表

    public Role(String emplName, List<Integer> permissions) {
        this.emplName = emplName;
        this.permissions = permissions;
    }

    public boolean hasPermission(int permission) {
        return permissions.contains(permission);
    }


}
